home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10649 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: cygnus.com!not-for-mail
  2. From: mrs@cygnus.com (Mike Stump)
  3. Newsgroups: gnu.g++.help,comp.lang.c++
  4. Subject: Re: 3Q's:  stdio.h, unary minus, declaration/definition
  5. Date: 8 Mar 1996 14:20:08 -0800
  6. Organization: Cygnus Support, Mountain View, CA
  7. Message-ID: <4hqbqo$pkk@cygnus.com>
  8. References: <Pine.SUN.3.91.960307143932.2763A-100000@grad>
  9. NNTP-Posting-Host: cygnus.com
  10.  
  11. In article <Pine.SUN.3.91.960307143932.2763A-100000@grad>,
  12. Timothy Miller  <millert@csee.usf.edu> wrote:
  13. >
  14. >I have Stroustrup's book on C++, and his use of the terms 'declaration' 
  15. >and 'definition' are odd to me.
  16. >
  17. >With a few exceptions, Stroustrup's book uses definition and
  18. >declaration completely reverse of what I was taught in school and by
  19. >books on programming C that I have read.
  20. >
  21. >Is he making a mistake or am I?
  22.  
  23. Think about the English language.  A definition is meant to fully
  24. describe the term, in the definition, one can use other terms that are
  25. defined elsewhere.  A definition is a substantial thing.  (If your
  26. dictionary if less then 4 inches thick, go find a real dictionary, and
  27. lookup a simple work, like `a'.  You will find something rather
  28. complete, and quite long.
  29.  
  30. For example, consider:
  31.  
  32. void walk();
  33.  
  34. verses
  35.  
  36. void walk() {
  37.     while (1)
  38.     {
  39.         move_right_leg_forward ();
  40.         move_left_leg_forward ();
  41.     }
  42. }
  43.  
  44. and
  45.  
  46. walk (verb).
  47.  
  48. verses
  49.  
  50. walk (verb): The act of repeatedly moving the right leg forward, followed by
  51.          moving the left leg forward.
  52.  
  53.  
  54. and the words definition and declaration.  The longer form immediatly
  55. above seems to be a definition of the word walk.  The one just prior,
  56. just a declaration that the word walk is a verb.  The later is not
  57. considered a definition of the word walk.  In this same way, the first
  58. one above, is just a declaration of the verb, opps, I mean function
  59. walk.  It doesn't say what walk is.  To know what it is, you would
  60. have to consult a _definition_ of the work walk someplace.  The
  61. definition of walk appears just below the declaration.
  62.  
  63. Seems to make sense to me.  Can you cite the books and provide quotes?
  64. I am really curious to know if it is just you memory playing tricks on
  65. you, or if in fact someone else uses the terms differently.
  66.